import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Category from './views/Category.vue'
import News from './views/News.vue'
import Shopcar from './views/Shopcar.vue'
import Me from './views/Me.vue'

// 新闻详情
import NewsInfo from './views/NewsInfo.vue'
// 商品分类
import GoodsList from './views/GoodsList.vue'
//商品详情
import GoodsInfo from './views/GoodsInfo.vue'
//个人中心
import addressList from './components/me/addressList.vue'
import pwdReset from './components/me/pwdReset.vue'
import list from './components/me/list.vue'
import login from './components/me/login.vue'
import register from './components/me/register.vue'
import account from './components/me/account.vue'
import addressAdd from './components/me/addressAdd.vue'
import addressEdit from './components/me/addressEdit.vue'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: 'home',
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path:'/Category',
      name:'Category',
      component : Category
    },
    {
      path:'/News',
      name:'News',
      component :News
    },
    {
      path:'/Shopcar',
      name:'Shopcar',
      component :Shopcar
    },
    {
      path:'/Me',
      name:'Me',
      component :Me
    },
    {
      path:'/NewsInfo',
      name:'NewsInfo',
      component :NewsInfo
    },
    
    {
      path:'/GoodsInfo/:id',
      name:'GoodsInfo',
      component : GoodsInfo
    },
    {
      path:'/GoodsList',
      name:'GoodsList',
      component :GoodsList
    },
    {
      path:'/me',
      component:Me,
      redirect:"/me/list",
      children:[
        {
          path:'list',
          component:list,
        },
        {
          path:'login',
          component:login
        },{
          path:"register",
          component:register
        }
      ]
    }
    
   
   
   
    
    // {
    //   path: '/about',
    //   name: 'about',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // }
  ]
})
